include(FetchContent)

## libuv
FetchContent_Declare(
        libuv
        GIT_REPOSITORY https://gitee.com/mirrors/libuv.git
        GIT_TAG v1.x # 库版本
        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/libuv # 指定库下载地址
)
FetchContent_MakeAvailable(libuv)
## Abseil
FetchContent_Declare(
        abseil-cpp
        GIT_REPOSITORY https://gitee.com/minhanghuang/abseil-cpp.git
        GIT_TAG master # 库版本
        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/abseil-cpp # 指定库下载地址
)
FetchContent_MakeAvailable(abseil-cpp)
## flatbuffers
FetchContent_Declare(
        flatbuffers
        GIT_REPOSITORY https://gitee.com/jackyshiy/flatbuffers.git
        GIT_TAG master # 库版本
        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/flatbuffers # 指定库下载地址
)
FetchContent_MakeAvailable(flatbuffers)

## usrsctp
FetchContent_Declare(
        usrsctp
        GIT_REPOSITORY https://gitee.com/varlet_mirror/usrsctp.git
        GIT_TAG master # 库版本
        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/usrsctp # 指定库下载地址
)
FetchContent_MakeAvailable(usrsctp)

## libsrtp
FetchContent_Declare(
        libsrtp
        GIT_REPOSITORY https://github.com/versatica/libsrtp.git
        GIT_TAG v3.0-alpha # 库版本
        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/libsrtp # 指定库下载地址
)
FetchContent_MakeAvailable(libsrtp)

if (UNIX)
    ## liburing
    FetchContent_Declare(
            liburing
            GIT_REPOSITORY https://gitee.com/xsjkiver/liburing.git
            GIT_TAG master # 库版本
            SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/liburing # 指定库下载地址
    )
    FetchContent_MakeAvailable(liburing)
endif ()

## mediasoup
FetchContent_Declare(
        mediasoup
        GIT_REPOSITORY https://github.com/versatica/mediasoup.git
        GIT_TAG v3 # 库版本
        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/mediasoup # 指定库下载地址
)

FetchContent_MakeAvailable(mediasoup)


## wingetopt
FetchContent_Declare(
        wingetopt
        GIT_REPOSITORY https://github.com/alex85k/wingetopt.git
        GIT_TAG master # 库版本
        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/wingetopt # 指定库下载地址
)

FetchContent_MakeAvailable(wingetopt)

## sigslot
FetchContent_Declare(
        sigslot
        GIT_REPOSITORY https://github.com/palacaze/sigslot.git
        GIT_TAG master # 库版本
        SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/sigslot # 指定库下载地址
)

FetchContent_MakeAvailable(sigslot)


add_subdirectory(mediasoup)